# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-mopidy-spotify
pkgver=4.1.1_git20230322
pkgrel=1
_commit="a82e1b2016dbfeddb4ac9c6027c2cdaf0331b9b1"
pkgdesc="Mopidy extension for playing music from Spotify"
url="https://mopidy.com/ext/spotify/"
# armhf armv7 ppc64le riscv64 s390x x86 blocked by gst-plugins-rs
arch="noarch !armhf !armv7 !ppc64le !riscv64 !s390x !x86"
license="Apache-2.0"
depends="
	gst-plugins-rs
	mopidy
	py3-responses
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/mopidy/mopidy-spotify/archive/$_commit/mopidy-spotify-$_commit.tar.gz"
builddir="$srcdir/mopidy-spotify-$_commit"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
fc34d5d27eb30f9963bb16fe407972c4929666055412b21ff0a4e4a0173ad1dad5f55f77bc42fcbfeee283ab6be5b6721eccd7aa06d991dd3edfe27c54b4fc23  mopidy-spotify-a82e1b2016dbfeddb4ac9c6027c2cdaf0331b9b1.tar.gz
"
